.class public Lcom/instagram/h/b/e;
.super Landroid/widget/BaseAdapter;
.source "SurveyAdapter.java"

# interfaces
.implements Landroid/widget/ListAdapter;


# instance fields
.field private a:Lcom/instagram/h/b/b;

.field private b:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/instagram/h/b/b;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 22
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 23
    iput-object p1, p0, Lcom/instagram/h/b/e;->b:Landroid/content/Context;

    .line 24
    iput-object p2, p0, Lcom/instagram/h/b/e;->a:Lcom/instagram/h/b/b;

    .line 25
    return-void
.end method

.method private static a(Landroid/content/Context;Ljava/lang/String;)I
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 89
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    .line 90
    const-string v1, "green"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 91
    sget v1, Lcom/facebook/at;->sentiment_tool_green_text_color:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    .line 101
    :goto_0
    return v0

    .line 92
    :cond_0
    const-string v1, "lightgreen"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 93
    sget v1, Lcom/facebook/at;->sentiment_tool_light_green_text_color:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    goto :goto_0

    .line 94
    :cond_1
    const-string v1, "yellow"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 95
    sget v1, Lcom/facebook/at;->sentiment_tool_yellow_text_color:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    goto :goto_0

    .line 96
    :cond_2
    const-string v1, "orange"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    .line 97
    sget v1, Lcom/facebook/at;->sentiment_tool_orange_text_color:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    goto :goto_0

    .line 98
    :cond_3
    const-string v1, "red"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_4

    .line 99
    sget v1, Lcom/facebook/at;->sentiment_tool_red_text_color:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    goto :goto_0

    .line 101
    :cond_4
    sget v1, Lcom/facebook/at;->sentiment_tool_gray_text_color:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getColor(I)I

    move-result v0

    goto :goto_0
.end method

.method private a(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
    .locals 2
    .parameter
    .parameter
    .parameter

    .prologue
    .line 54
    invoke-virtual {p0, p2}, Lcom/instagram/h/b/e;->getItemViewType(I)I

    move-result v0

    packed-switch v0, :pswitch_data_0

    .line 61
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "Unhandled view type"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 56
    :pswitch_0
    sget v0, Lcom/facebook/ax;->sentiment_tool_answer:I

    const/4 v1, 0x0

    invoke-static {p1, v0, v1}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    .line 63
    return-object v0

    .line 54
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
    .end packed-switch
.end method

.method private a(Landroid/content/Context;Landroid/view/View;I)V
    .locals 3
    .parameter
    .parameter
    .parameter

    .prologue
    .line 77
    invoke-virtual {p0, p3}, Lcom/instagram/h/b/e;->getItemViewType(I)I

    move-result v0

    packed-switch v0, :pswitch_data_0

    .line 84
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "View type unhandled"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 79
    :pswitch_0
    iget-object v0, p0, Lcom/instagram/h/b/e;->a:Lcom/instagram/h/b/b;

    invoke-virtual {v0}, Lcom/instagram/h/b/b;->f()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/h/b/c;

    move-object v1, p2

    .line 80
    check-cast v1, Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/instagram/h/b/c;->b()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 81
    check-cast p2, Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/instagram/h/b/c;->c()Ljava/lang/String;

    move-result-object v0

    invoke-static {p1, v0}, Lcom/instagram/h/b/e;->a(Landroid/content/Context;Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p2, v0}, Landroid/widget/TextView;->setTextColor(I)V

    .line 86
    return-void

    .line 77
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
    .end packed-switch
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 29
    iget-object v0, p0, Lcom/instagram/h/b/e;->a:Lcom/instagram/h/b/b;

    invoke-virtual {v0}, Lcom/instagram/h/b/b;->f()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .parameter "position"

    .prologue
    .line 34
    iget-object v0, p0, Lcom/instagram/h/b/e;->a:Lcom/instagram/h/b/b;

    invoke-virtual {v0}, Lcom/instagram/h/b/b;->f()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .parameter "position"

    .prologue
    .line 39
    int-to-long v0, p1

    return-wide v0
.end method

.method public getItemViewType(I)I
    .locals 2
    .parameter "position"

    .prologue
    .line 68
    invoke-virtual {p0}, Lcom/instagram/h/b/e;->getCount()I

    move-result v0

    if-ge p1, v0, :cond_0

    .line 70
    const/4 v0, 0x0

    return v0

    .line 72
    :cond_0
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "View mode not handled (for item view type)"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 1
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 44
    if-nez p2, :cond_0

    .line 45
    iget-object v0, p0, Lcom/instagram/h/b/e;->b:Landroid/content/Context;

    invoke-direct {p0, v0, p1, p3}, Lcom/instagram/h/b/e;->a(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 47
    :cond_0
    iget-object v0, p0, Lcom/instagram/h/b/e;->b:Landroid/content/Context;

    invoke-direct {p0, v0, p2, p1}, Lcom/instagram/h/b/e;->a(Landroid/content/Context;Landroid/view/View;I)V

    .line 49
    return-object p2
.end method
